#include<iostream>
using namespace std;
#include"memory.h"

struct Date
{
	~Date()
	{
		cout << "~Date" << endl;
	}
	int _day = 1;
	int _month = 1;
	int _year = 1;
};

struct ListNode
{
	~ListNode()
	{
		cout << "~ListNode" << endl;
	}
	int date = 1;
	MoYu::weak_ptr<ListNode> _next;
	MoYu::weak_ptr<ListNode> _prev;
};

int main()
{
	//MoYu::shared_ptr<Date> sp1(new Date);
	//MoYu::shared_ptr<Date> sp2(sp1);
	//MoYu::shared_ptr<Date> sp3(new Date);
	//MoYu::shared_ptr<Date> sp4(sp2);

	////sp1 = sp3;
	//sp3 = sp1;

	//MoYu::shared_ptr<Date> sp5(new Date[10], [](Date*& ptr) 
	//	{
	//		delete[] ptr; 
	//	});



	MoYu::shared_ptr<ListNode> _node1(new ListNode);
	MoYu::shared_ptr<ListNode> _node2(new ListNode);

	_node1->_next = _node2;
	_node2->_prev = _node1;
}